home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj0987.arc
/
RESOLUT.C
< prev
next >
Wrap
Text File
|
1987-06-30
|
16KB
|
323 lines
/*
* RESOLUT -- PC Tech Journal Laser Printer Resolution Test
*
* Version 1.0
*
* Copyright (c) 1987, Ziff Communications Company
* Program by: Rainer McCown and Bob Smith
*
* Prints a series of high-resolution patterns showing detailing
* capabilities of laser printers
*/
#include "io.h"
#define MSIZ 64
char mat[][MSIZ+1] = {
"0000000000000001000000000000000000000000000000001000000000000000",
"0000000000000001100000000000000000000000000000011000000000000000",
"0000000000000001110000000000000000000000000000111000000000000000",
"0000000000000001111000000000000000000000000001111000000000000000",
"0000000000000001111100000000000000000000000011111000000000000000",
"0000000000000001111110000000000000000000000111111000000000000000",
"0000000000000001111111000000000000000000001111111000000000000000",
"0000000000000001111111100000000000000000011111111000000000000000",
"0000000000000001111111110000000000000000111111111000000000000000",
"1111111111111111111111111000000000000001111111111111111111111111",
"1111111111111111111111111100000000000011111111111111111111111111",
"1111111111111111111111111110000000000111111111111111111111111111",
"1111111111111111111111111111000000001111111111111111111111111111",
"1111111111111111111111111111100000011111111111111111111111111111",
"1111111111111111111111111111110000111111111111111111111111111111",
"1111111111111111111111111111111001111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111001111111111111111111111111111111",
"1111111111111111111111111111110000111111111111111111111111111111",
"1111111111111111111111111111100000011111111111111111111111111111",
"1111111111111111111111111111000000001111111111111111111111111111",
"1111111111111111111111111110000000000111111111111111111111111111",
"1111111111111111111111111100000000000011111111111111111111111111",
"1111111111111111111111111000000000000001111111111111111111111111",
"0000000000000001111111110000000000000000111111111000000000000000",
"0000000000000001111111100000000000000000011111111000000000000000",
"0000000000000001111111000000000000000000001111111000000000000000",
"0000000000000001111110000000000000000000000111111000000000000000",
"0000000000000001111100000000000000000000000011111000000000000000",
"0000000000000001111000000000000000000000000001111000000000000000",
"0000000000000001110000000000000000000000000000111000000000000000",
"0000000000000001100000000000000000000000000000011000000000000000",
"0000000000000001000000000000000000000000000000001000000000000000",
};
char mat1[][MSIZ+1] = {
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
"0101010101010101010101010101010101010101010101010101010101010101",
};
char mat2[][MSIZ+1] = {
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
"1010101010101010101010101010101010101010101010101010101010101010",
"1110111011101110111011101110111011101110111011101110111011101110",
"0000000000000000000000000000000000000000000000000000000000000000",
"1110111011101110111011101110111011101110111011101110111011101110",
};
char mat3[][MSIZ+1] = {
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
"0000000000000000000000000000000000000000000000000000000000000000",
"1010101010101010101010101010101010101010101010101010101010101010",
};
char mat4[][MSIZ+1] = {
"0000000000000000000000000000000000000000000000000000000000000000",
"1111110001111100000011111000000000000000000000000000000000000000",
"0001110010001110000100011100000000000000000000000000000000000000",
"0001110100000011001000000110000000000000000000000000000000000000",
"0001111000000011110000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"0001110000000011100000000111000000000000000000000000000000000000",
"1111111110011111111100111111111000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
};
char mat5[][MSIZ+1] = {
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
"1111111111111111111111111111111111111111111111111111111111111111",
};
struct PRT_LINE
{
char lhd[5];
char line[MSIZ/8];
};
struct PRT_LINE
prt_line = {'\x1B', '*', 'b', '0'+MSIZ/8, 'W'};
#define LINE_LEN sizeof(prt_line)
#define STD_OUT 1
extern void sndl(char [], int),
snd (char []),
setbinary(int);
/*************************** PMAT **********************************/
void pmat(mats)
char mats[][MSIZ+1];
{
int row, col, bit;
unsigned char byte;
/* Send header info to printer */
snd("\x1B*p+200x0100Y"); /* Position the output on the page */
snd("\x1B*r1A"); /* Start raster graphics mode */
/* Translate MATS into bits for output to printer */
for (row = 0; row < sizeof(mat)/sizeof(mat[0]); row++)
{
for (col = 0; col < MSIZ; col += 8)
{
for (byte = 0, bit = 0; bit < 8; bit++)
byte = (byte << 1) | (mats[row][col + bit] == '1');
prt_line.line[col >> 3] = byte;
}
/* Write out a line's worth */
sndl((char *) &prt_line, LINE_LEN);
}
/* End raster graphics mode */
snd("\x1B*rB");
}
/******************************* MAIN *******************************/
void main()
{
int row, col, bit;
unsigned char byte;
/* Change STD_OUT to binary mode to avoid
converting LFs to CR,LF and to avoid
stopping on EOFs
*/
setbinary(STD_OUT);
/* Initialize the printer */
snd("\x1BE"); /* Reset the printer */
snd("\x1B&l0O"); /* Portrait mode */
snd("\x1B*t300R"); /* Set the printer resolution */
/* Send the bit patterns to the printer */
pmat(mat);
pmat(mat1);
pmat(mat2);
pmat(mat3);
pmat(mat4);
pmat(mat5);
/* Eject the paper */
snd("\f");
} /* End MAIN */